﻿using UnityEngine;
using System.Collections;
using UnityEditor;

public class EnemySight : MonoBehaviour {

	public Vector3 position;
	public Vector3 viewDirection;
	public Vector3 viewPlaneNormal;
	public float radius;
	public float angle;
	public Color onSightColor;
	public Color patrolColor;

	private bool onSight;
	public void OnDrawGizmos(){
		Handles.color = onSight ? onSightColor : patrolColor;
		Handles.color = new Color(Handles.color.r, Handles.color.g, Handles.color.b, 0.2f);
		Handles.DrawSolidArc (transform.position + position, viewPlaneNormal, viewDirection, Mathf.Clamp(angle,0,360)/2, radius);
		Handles.DrawSolidArc (transform.position + position, viewPlaneNormal, viewDirection, -Mathf.Clamp(angle,0,360)/2, radius);
	}
}
